home *** CD-ROM | disk | FTP | other *** search
/ Internet the City / Internet The City.iso / mac / Internet the City™ Files / itcres / data.Dxr / Internal_1_Main.ls < prev    next >
Encoding:
Text File  |  1997-06-03  |  20.4 KB  |  883 lines

  1. global gHIliteSprite, gfilepath, gDriveletter, gRollWaitTime, gGuideChosen, gGuideInitial, gRightCD, gStopActions, gCDscript, gBuildingChosen, gSoundfilePlayed, gmovieobj, gAfterSwapScript, gAfterMovieFrame, gVideoSprite, gMovieMaxed, gSliderSprite, gMovieIncrement, gLMObjList, gUMObjList, gUMspritelist, gUpperTextSprite, gPC, gcafescreen, gMovieFrame, gGuideFrame, gMainFrame, gBuilding1, gBuilding2, gBuilding3, gTutorialFrame, gBuilding4, gBuilding5, gBuilding6, gBuilding7, gBuilding8, gGuide1Frame, gGuide2Frame, gGuide3Frame, gDefaultText, gLMspritelist, gHiliteobj, gTextSprite, gLastframe, gLastBuilding, gPrintScreen, gBlimpSprite, gBlimpSpeed, gblimploc, gblimptrigger, gBlimpPause, gTaxiflown, gPrintlist, gNetClicked, gcdno, gDboxType, gCDready, guppertext, gcreditscroll, gCreditsScreen, gscrolllength, gSaveGuide, gVersionType, gTotalDiscs, gCDGuidelist, gMovieSuffix
  2.  
  3. on startMovie
  4.   startTimer()
  5.   set the keyUpScript to "zkey"
  6.   unLoad()
  7.   soundinit()
  8.   checkQuicktime()
  9.   cursor(4)
  10.   set the idleLoadMode to 0
  11.   set the searchCurrentFolder to 1
  12.   set gVersionType to #mini1
  13.   set the visible of sprite 25 to 1
  14.   set the visible of sprite 21 to 1
  15.   setglobals()
  16.   buildlowermenu()
  17.   buildmaintextlist()
  18.   checkmemory()
  19.   checkRightCD()
  20.   waitUntil4()
  21.   cursor(-1)
  22.   if gCDready = 0 then
  23.     switchcd()
  24.   end if
  25. end
  26.  
  27. on stopMovie
  28.   if not voidp(gLMObjList) then
  29.     clearlowermenu()
  30.   end if
  31.   if not voidp(gUMObjList) then
  32.     clearUPPERmenu()
  33.   end if
  34.   set the fileName of castLib 3 to the pathName & "empty.cst"
  35. end
  36.  
  37. on checkversion
  38.   if the controlDown then
  39.     put "Internet The City(tm) " & gVersionType & " Version 1.02 IE/NS  5/29/97" into line 1 of msg
  40.     put "Platform: " & the platform into line 2 of msg
  41.     put "Memorysize = " & the memorysize / 1024 into line 3 of msg
  42.     put "Free Memory = " & the freeBytes / 1024 into line 4 of msg
  43.     put "Free Block = " & the freeBlock / 1024 into line 5 of msg
  44.     put "Color Depth = " & the colorDepth into line 6 of msg
  45.     alert(msg)
  46.   end if
  47. end
  48.  
  49. on setglobals
  50.   getplat()
  51.   set gCreditsScreen to label("credits")
  52.   case gVersionType of
  53.     #Lite:
  54.       set gCDGuidelist to [[1, 2, 3], []]
  55.       set gTotalDiscs to 1
  56.       set gcdno to 0
  57.       set gPrintScreen to label("print(disabled)")
  58.       set frameoffset to 1
  59.       set gMainFrame to label("main")
  60.     #mini1:
  61.       set gCDGuidelist to [[1, 2, 3], []]
  62.       set gTotalDiscs to 1
  63.       set gcdno to 0
  64.       set gPrintScreen to label("print")
  65.       set frameoffset to 0
  66.       set gMainFrame to label("minimain")
  67.       set gCreditsScreen to label("minicredits")
  68.       set the visible of sprite 21 to 0
  69.     otherwise:
  70.       set gCDGuidelist to [[2], [1, 3]]
  71.       set gcdno to 0
  72.       set gTotalDiscs to 2
  73.       set gPrintScreen to label("print")
  74.       set frameoffset to 0
  75.       set gMainFrame to label("main")
  76.   end case
  77.   set gDboxType to #CDswap
  78.   set gVideoSprite to 40
  79.   set gGuideChosen to 0
  80.   set gmovieobj to 0
  81.   set gBuildingChosen to 4
  82.   set gHIliteSprite to 47
  83.   puppetSprite(gHIliteSprite, 1)
  84.   set gBlimpSprite to 15
  85.   set gBlimpSpeed to getAt([-1, 1], random(2))
  86.   set gblimploc to 690
  87.   case gBlimpSpeed of
  88.     1:
  89.       set gblimploc to -50
  90.     (-1):
  91.       set gblimploc to 690
  92.   end case
  93.   set gBlimpPause to 2
  94.   set gTaxiflown to 0
  95.   set gStopActions to 0
  96.   set gAfterSwapScript to EMPTY
  97.   set gMovieFrame to label("movies")
  98.   set gTutorialFrame to label("tutorials")
  99.   set gGuideFrame to label("guides")
  100.   set gGuide1Frame to label("guidemov1")
  101.   set gGuide2Frame to label("guidemov2")
  102.   set gGuide3Frame to label("guidemov3")
  103.   set gBuilding1 to label("Building1") + frameoffset
  104.   set gBuilding2 to label("Building2") + frameoffset
  105.   set gBuilding3 to label("Building3") + frameoffset
  106.   set gBuilding4 to label("Building4")
  107.   set gBuilding5 to label("Building5") + frameoffset
  108.   set gBuilding6 to label("Building6") + frameoffset
  109.   set gBuilding7 to label("Building7")
  110.   set gBuilding8 to label("Building8")
  111.   set gAfterMovieFrame to gGuideFrame
  112.   set gDefaultText to 0
  113.   setdefaulttext("txt_mov.PIC")
  114.   set gLMspritelist to [17, 18, 19, 20, 21, 22]
  115.   set gUMspritelist to [30, 31, 32, 33, 34, 35, 36, 37]
  116.   set gHiliteobj to 0
  117.   set gTextSprite to 23
  118.   set gUpperTextSprite to 38
  119.   set guppertext to 65
  120.   puppetSprite(gTextSprite, 1)
  121.   set gMovieMaxed to 0
  122.   set gMovieIncrement to 0
  123.   set gGuideInitial to "e"
  124.   if voidp(gDriveletter) then
  125.     set gDriveletter to "D:"
  126.   end if
  127.   if gPC then
  128.     set gfilepath to gDriveletter & "\fREFd\"
  129.   end if
  130.   set gSliderSprite to 46
  131.   set gLastframe to gGuideFrame
  132.   set gRollWaitTime to 60
  133.   set gPrintlist to []
  134.   set gLMObjList to []
  135.   set gUMObjList to []
  136.   set gNetClicked to 0
  137.   clearUPPERmenu()
  138.   setCDscript()
  139. end
  140.  
  141. on checkQuicktime
  142.   if the quickTimePresent then
  143.     exit
  144.   end if
  145.   alert("QuickTime has not been properly installed on this computer. Please refer to the ITC installation instructions to install the correct version of QuickTime.")
  146.   over()
  147. end
  148.  
  149. on playclick
  150.   puppetSound("Click Out.aif")
  151.   updateStage()
  152.   waitSound()
  153.   puppetSound(0)
  154. end
  155.  
  156. on quickclick
  157.   puppetSound("click out.aif")
  158.   updateStage()
  159. end
  160.  
  161. on exitFrame
  162.   checkLowerRoll()
  163.   case gCDready of
  164.     0:
  165.       do(gCDscript)
  166.   end case
  167. end
  168.  
  169. on PreEjectScript
  170.   checkRightCD()
  171.   go(the frame)
  172. end
  173.  
  174. on PostEjectScript
  175.   go(the frame)
  176.   case gcdno of
  177.     0:
  178.       set gCDscript to "PreEjectScript"
  179.     otherwise:
  180.       checkCDno()
  181.   end case
  182. end
  183.  
  184. on checkkey
  185.   if the keyCode = 49 then
  186.     switchmoviesize()
  187.   end if
  188.   dontPassEvent()
  189. end
  190.  
  191. on navigate where
  192.   cursor(4)
  193.   endmovie()
  194.   ENDBUILDING()
  195.   manageunload(where)
  196.   go(where)
  197.   case gVersionType of
  198.     #full:
  199.       set p to 1
  200.     #nns:
  201.       set p to 2
  202.     #mini1:
  203.       set p to 2
  204.     #Lite:
  205.       set p to 3
  206.     otherwise:
  207.       set p to 1
  208.   end case
  209.   case where of
  210.     gMovieFrame:
  211.       setdefaulttext("txt_mov.PIC")
  212.     gGuideFrame:
  213.       updateStage()
  214.       set gSaveGuide to gGuideChosen
  215.       set gBuildingChosen to 0
  216.       set gLastframe to where
  217.       setdefaulttext("txt_g.PIC")
  218.       preloadguides()
  219.     gMainFrame:
  220.       set gGuideChosen to gSaveGuide
  221.       set gBuildingChosen to 0
  222.       set gLastframe to where
  223.       setdefaulttext(getAt(["mtxt_m.PIC", "mtxt_m.PIC", "ltxt_m.PIC"], p))
  224.       preloadMenu()
  225.       startTimer()
  226.       startBlimp()
  227.     gBuilding1:
  228.       set gLastframe to where
  229.       buildUppermenu()
  230.       setdefaulttext(getAt(["tutxt_em.PIC", "tutxt_em.PIC", "rtn_mtxt.PIC"], p))
  231.     gBuilding2:
  232.       set gLastframe to where
  233.       buildUppermenu()
  234.       setdefaulttext(getAt(["tutxt_fp.PIC", "tutxt_fp.PIC", "rtn_mtxt.PIC"], p))
  235.     gBuilding3:
  236.       set gLastframe to where
  237.       buildUppermenu()
  238.       setdefaulttext(getAt(["tutxt_ic.PIC", "tutxt_ic.PIC", "rtn_mtxt.PIC"], p))
  239.     gcafescreen:
  240.       set gLastBuilding to gBuildingChosen
  241.       buildbuttonmenu()
  242.       setdefaulttext(getAt(["nc_mtxt.PIC", "nsnc_mtxt.PIC", "nsnc_mtxt.PIC"], p))
  243.     gBuilding5:
  244.       set gLastframe to where
  245.       buildUppermenu()
  246.       setdefaulttext(getAt(["tutxt_gp.PIC", "tutxt_gp.PIC", "rtn_mtxt.PIC"], p))
  247.     gBuilding6:
  248.       set gLastframe to where
  249.       buildUppermenu()
  250.       setdefaulttext(getAt(["tutxt_us.PIC", "tutxt_us.PIC", "rtn_mtxt.PIC"], p))
  251.     gBuilding7:
  252.       set gLastframe to where
  253.       buildUppermenu()
  254.       setdefaulttext(getAt(["tutxt_tl.PIC", "tutxt_tl.PIC", "ltxt_oex.pic"], p))
  255.     gBuilding8:
  256.       set gLastframe to where
  257.       buildUppermenu()
  258.       setdefaulttext(getAt(["tutxt_wb.PIC", "tutxt_wb.PIC", "ltxt_oex.pic"], p))
  259.     otherwise:
  260.       cursor(-1)
  261.       exit
  262.   end case
  263.   setDisplaytext(gDefaultText)
  264.   cursor(-1)
  265. end
  266.  
  267. on ENDBUILDING
  268.   puppetSprite(1, 0)
  269.   puppetSprite(2, 0)
  270.   puppetSprite(gBlimpSprite, 0)
  271.   clearUPPERmenu()
  272. end
  273.  
  274. on setdefaulttext which
  275.   unloadMember(gDefaultText)
  276.   set gDefaultText to the number of member which
  277. end
  278.  
  279. on setDisplaytext which
  280.   set the memberNum of sprite gTextSprite to which
  281. end
  282.  
  283. on setUpperDisplayText which
  284.   set the memberNum of sprite gUpperTextSprite to which
  285. end
  286.  
  287. on preloadMenu
  288.   case gVersionType of
  289.     #mini1:
  290.       repeat with x = 169 to 173
  291.         preloadMember(member x of castLib 1)
  292.       end repeat
  293.     otherwise:
  294.       repeat with x = 181 to 196
  295.         preloadMember(member x of castLib 1)
  296.       end repeat
  297.   end case
  298. end
  299.  
  300. on preloadguides
  301.   repeat with x in [198, 199, 200, 202, 203, 204, 206, 207, 208, 210, 211, 212, 213]
  302.     preloadMember(member x of castLib 1)
  303.   end repeat
  304. end
  305.  
  306. on UnloadGuides
  307.   repeat with x = 198 to 213
  308.     unloadMember(member x of castLib 1)
  309.   end repeat
  310.   unloadguidemovies()
  311.   unloadMember(member 114 of castLib 1)
  312. end
  313.  
  314. on unloadguidemovies
  315.   if the fileName of castLib 3 contains "empty.cst" then
  316.     exit
  317.   end if
  318.   repeat with x = 4 to 6
  319.     unloadMember(member x of castLib 3)
  320.   end repeat
  321. end
  322.  
  323. on unloadMenu
  324.   repeat with x = 170 to 196
  325.     unloadMember(member x of castLib 1)
  326.   end repeat
  327.   unloadMember(member 117 of castLib 1)
  328.   unloadMember(member 166 of castLib 1)
  329. end
  330.  
  331. on unloadmovies
  332.   repeat with x = 100 to 108
  333.     unloadMember(member x of castLib 1)
  334.   end repeat
  335. end
  336.  
  337. on waitUntil4
  338.   repeat while the timer < (4 * 60)
  339.     go(the frame)
  340.   end repeat
  341. end
  342.  
  343. on over
  344.   cursor(4)
  345.   endmovie()
  346.   set the visible of sprite gVideoSprite to 0
  347.   repeat with x = 1 to 48
  348.     puppetSprite(x, 0)
  349.   end repeat
  350.   go(1)
  351.   startTimer()
  352.   set the visible of sprite gVideoSprite to 1
  353.   waitUntil4()
  354.   pause()
  355.   stopMovie()
  356.   cursor(-1)
  357.   quit()
  358.   abort()
  359. end
  360.  
  361. on wait howlong
  362.   set endtime to the ticks + howlong
  363.   repeat while the ticks < endtime
  364.   end repeat
  365. end
  366.  
  367. on waitSound
  368.   repeat while soundBusy(1)
  369.     updateStage()
  370.   end repeat
  371. end
  372.  
  373. on unloadbuilding
  374.   set memberno to getAt([253, 263, 269, 237, 266, 244, 275, 279], gBuildingChosen)
  375.   set castlist to [memberno, memberno - 1, 228, 225]
  376.   repeat with x in castlist
  377.     unloadMember(member x of castLib 1)
  378.   end repeat
  379. end
  380.  
  381. on unloadCafe
  382.   repeat with x = 230 to 240
  383.     unloadMember(member x of castLib 1)
  384.   end repeat
  385.   unloadMember(member 123 of castLib 1)
  386. end
  387.  
  388. on soundinit
  389.   set the volume of sound 1 to 0
  390.   playclick()
  391.   set the volume of sound 1 to 255
  392. end
  393.  
  394. on clearmember num
  395.   unloadMember(member num of castLib 1)
  396. end
  397.  
  398. on manageunload where
  399.   if the freeBytes > 1600000 then
  400.     exit
  401.   end if
  402.   set f to marker(0)
  403.   case f of
  404.     gGuideFrame:
  405.       UnloadGuides()
  406.     gGuide1Frame:
  407.       UnloadGuides()
  408.     gGuide2Frame:
  409.       UnloadGuides()
  410.     gGuide3Frame:
  411.       UnloadGuides()
  412.     gMainFrame:
  413.       unloadMenu()
  414.     gBuilding1:
  415.       clearmember(253)
  416.       clearmember(252)
  417.     gBuilding2:
  418.       clearmember(263)
  419.       clearmember(262)
  420.     gBuilding3:
  421.       clearmember(269)
  422.       clearmember(268)
  423.     gBuilding4:
  424.       unloadCafe()
  425.     gBuilding5:
  426.       clearmember(266)
  427.       clearmember(265)
  428.     gBuilding6:
  429.       clearmember(244)
  430.       clearmember(243)
  431.     gBuilding7:
  432.       clearmember(275)
  433.       clearmember(274)
  434.     gBuilding8:
  435.       clearmember(279)
  436.       clearmember(278)
  437.     gTutorialFrame:
  438.       unloadbuilding()
  439.       unloadmovies()
  440.     gCreditsScreen:
  441.       unloadcredits()
  442.       if where <> gMainFrame then
  443.         unloadMenu()
  444.       end if
  445.   end case
  446. end
  447.  
  448. on checkmemory
  449.   set fb to the freeBytes
  450.   if fb > 2000000 then
  451.     preloadguides()
  452.     preloadMenu()
  453.   else
  454.     if fb < 1000000 then
  455.       exit
  456.       if the colorDepth <= 8 then
  457.         alert("Memory setting is low. You may have trouble running ITC! (Hold down Control Key to skip this message)")
  458.       else
  459.         alert("You may have trouble running ITC at this color depth! For best results, increase available memory or reduce your monitor's color setting to fewer colors. (Hold down Control Key to skip this message)")
  460.       end if
  461.     end if
  462.   end if
  463. end
  464.  
  465. on startBlimp
  466.   puppetSprite(gBlimpSprite, 1)
  467.   set gblimptrigger to the ticks + gBlimpPause
  468.   set the locH of sprite gBlimpSprite to gblimploc
  469.   case gBlimpSpeed of
  470.     1:
  471.       set the memberNum of sprite gBlimpSprite to 178
  472.     (-1):
  473.       set the memberNum of sprite gBlimpSprite to 177
  474.   end case
  475. end
  476.  
  477. on flipBlimp
  478.   if random(10) > 4 then
  479.     if gTaxiflown < 2 then
  480.       setTaxi()
  481.       exit
  482.     end if
  483.   end if
  484.   set gBlimpPause to 2
  485.   if (gTaxiflown mod 2) = 0 then
  486.     set gBlimpSpeed to 0 - gBlimpSpeed
  487.   end if
  488.   if gBlimpSpeed > 0 then
  489.     set gBlimpSpeed to 1
  490.     set gblimploc to -50
  491.     set the memberNum of sprite gBlimpSprite to 178
  492.   else
  493.     set gBlimpSpeed to -1
  494.     set gblimploc to 690
  495.     set the memberNum of sprite gBlimpSprite to 177
  496.   end if
  497.   set the locV of sprite gBlimpSprite to 10 + (random(8) * 10)
  498.   if gTaxiflown then
  499.     set gTaxiflown to 0
  500.     unloadtaxi()
  501.   end if
  502. end
  503.  
  504. on flyblimp
  505.   if the ticks < gblimptrigger then
  506.     exit
  507.   end if
  508.   set gblimploc to gblimploc + gBlimpSpeed
  509.   set gblimptrigger to the ticks + gBlimpPause
  510.   if gblimploc < -50 then
  511.     flipBlimp()
  512.   else
  513.     if gblimploc > 690 then
  514.       flipBlimp()
  515.     else
  516.       set the locH of sprite gBlimpSprite to gblimploc
  517.     end if
  518.   end if
  519. end
  520.  
  521. on setTaxi
  522.   set gBlimpPause to 0
  523.   set gBlimpSpeed to 0 - gBlimpSpeed
  524.   if gBlimpSpeed > 0 then
  525.     set gBlimpSpeed to 10
  526.     set gblimploc to -50
  527.     set the memberNum of sprite gBlimpSprite to 176
  528.   else
  529.     set gBlimpSpeed to -10
  530.     set gblimploc to 690
  531.     set the memberNum of sprite gBlimpSprite to 175
  532.   end if
  533.   set the locV of sprite gBlimpSprite to random(7) * 50
  534.   set gTaxiflown to gTaxiflown + 1
  535.   if not soundBusy(1) then
  536.     puppetSound("taxisnd")
  537.   end if
  538. end
  539.  
  540. on unloadtaxi
  541.   puppetSound(0)
  542.   repeat with x = 174 to 176
  543.     clearmember(x)
  544.   end repeat
  545. end
  546.  
  547. on flashcafe
  548.   if the timer < 60 then
  549.     go(gMainFrame)
  550.   else
  551.     go(gMainFrame + 4)
  552.     if the timer > 120 then
  553.       startTimer()
  554.     end if
  555.   end if
  556. end
  557.  
  558. on unloadprint
  559.   repeat with x = 141 to 144
  560.     clearmember(x)
  561.   end repeat
  562. end
  563.  
  564. on unloaddialog
  565.   repeat with x = 137 to 152
  566.     clearmember(x)
  567.   end repeat
  568. end
  569.  
  570. on ifRightCD what
  571.   set gAfterSwapScript to what
  572.   checkRightCD()
  573.   if gRightCD = 0 then
  574.     switchcd()
  575.     exit
  576.   end if
  577.   do(gAfterSwapScript)
  578.   set gAfterSwapScript to EMPTY
  579. end
  580.  
  581. on checkCDno
  582.   set temp to gcdno
  583.   case gPC of
  584.     0:
  585.       if getNthFileNameInFolder("ITC2:frefd:", 1) = "aaaa2" then
  586.         set gcdno to 2
  587.       else
  588.         if getNthFileNameInFolder("ITC1:frefd:", 1) = "aaaa1" then
  589.           set gcdno to 1
  590.         else
  591.           if getNthFileNameInFolder("ITC:frefd:", 1) = "aaaa1" then
  592.             set gcdno to 1
  593.           else
  594.             set gcdno to 0
  595.             exit
  596.           end if
  597.         end if
  598.       end if
  599.     otherwise:
  600.       set filepath to gDriveletter & "\frefd\"
  601.       if getNthFileNameInFolder(filepath, 1) = "aaaa2" then
  602.         set gcdno to 2
  603.       else
  604.         if getNthFileNameInFolder(filepath, 1) = "aaaa1" then
  605.           set gcdno to 1
  606.         else
  607.           set gcdno to 0
  608.           exit
  609.         end if
  610.       end if
  611.   end case
  612.   if temp <> gcdno then
  613.     setcastlib()
  614.   end if
  615. end
  616.  
  617. on checkRightCD
  618.   checkCDno()
  619.   set gRightCD to 0
  620.   case gcdno of
  621.     1:
  622.       set gCDready to 1
  623.       set wrongguides to getAt(gCDGuidelist, 2)
  624.       if getOne(wrongguides, gGuideChosen) then
  625.         setCDscript()
  626.         cleardbox()
  627.         exit
  628.       end if
  629.     2:
  630.       set gCDready to 1
  631.       set wrongguides to getAt(gCDGuidelist, 1)
  632.       if getOne(wrongguides, gGuideChosen) then
  633.         setCDscript()
  634.         cleardbox()
  635.         exit
  636.       end if
  637.     0:
  638.       set gCDready to 0
  639.       exit
  640.   end case
  641.   set gRightCD to 1
  642.   swapdone()
  643. end
  644.  
  645. on switchcd
  646.   cursor(4)
  647.   puppetSprite(41, 1)
  648.   set cdneeded to 1
  649.   case gVersionType of
  650.     #Lite:
  651.       if gPC = 16 then
  652.         set castno to the number of member "swap313.pic"
  653.         cursor(-1)
  654.       else
  655.         set castno to the number of member "swap3.pic"
  656.       end if
  657.       set CDname to "ITC"
  658.     #mini1:
  659.       if gPC = 16 then
  660.         set castno to the number of member "swap311.pic"
  661.         cursor(-1)
  662.       else
  663.         set castno to the number of member "swap1.pic"
  664.       end if
  665.       set CDname to "ITC1"
  666.     otherwise:
  667.       repeat with x = 1 to gTotalDiscs
  668.         if getOne(getAt(gCDGuidelist, x), gGuideChosen) then
  669.           set cdneeded to x
  670.           exit repeat
  671.         end if
  672.       end repeat
  673.       set CDname to "ITC" & gcdno & ":"
  674.       case cdneeded of
  675.         2:
  676.           if gPC = 16 then
  677.             set castno to the number of member "swap312.pic"
  678.             cursor(-1)
  679.           else
  680.             set castno to the number of member "swap2.pic"
  681.           end if
  682.         otherwise:
  683.           if gPC = 16 then
  684.             set castno to the number of member "swap311.pic"
  685.             cursor(-1)
  686.           else
  687.             set castno to the number of member "swap1.pic"
  688.           end if
  689.       end case
  690.   end case
  691.   set gDboxType to #CDswap
  692.   set the memberNum of sprite 41 to castno
  693.   set the loc of sprite 41 to point(320, 240)
  694.   updateStage()
  695.   unloadguidemovies()
  696.   if (gPC = 0) and gCDready then
  697.     if gTotalDiscs > 1 then
  698.       checkpurge()
  699.       openXLib("lns")
  700.       unmount(CDname)
  701.       closeXLib("lns")
  702.     end if
  703.   end if
  704.   set gCDready to 0
  705.   set gStopActions to 1
  706. end
  707.  
  708. on swapdone
  709.   cleardbox()
  710.   do(gAfterSwapScript)
  711.   set gAfterSwapScript to EMPTY
  712.   setCDscript()
  713. end
  714.  
  715. on setcastlib
  716.   if gPC = 0 then
  717.     case gVersionType of
  718.       #Lite:
  719.         set gfilepath to "ITC:frefd:"
  720.       otherwise:
  721.         set gfilepath to "ITC" & gcdno & ":frefd:"
  722.     end case
  723.   end if
  724.   set the searchPath to [gfilepath]
  725.   set the searchCurrentFolder to 0
  726.   unLoad(castLib 3)
  727.   set the fileName of castLib 3 to the pathName & "tut" & gcdno & ".cst"
  728.   set the searchCurrentFolder to 1
  729. end
  730.  
  731. on clickDbox
  732.   case gDboxType of
  733.     #CDswap:
  734.       clickCdswap()
  735.     #Net:
  736.       clicknetbox()
  737.     #OK:
  738.       clickOK()
  739.   end case
  740. end
  741.  
  742. on clickCdswap
  743.   set c to point(the mouseH, the mouseV)
  744.   case gPC of
  745.     16:
  746.       if inside(c, rect(353, 324, 410, 356)) then
  747.         paintpict(point(381, 339), "imp_ok.PIC", 1, 0)
  748.         quickclick()
  749.         repeat while the mouseDown
  750.         end repeat
  751.         paintpict(point(381, 339), "imp_ok.PIC", 0, 0)
  752.         if inside(point(the mouseH, the mouseV), rect(353, 324, 410, 356)) then
  753.           checkRightCD()
  754.         end if
  755.       else
  756.         if inside(c, rect(226, 325, 332, 356)) then
  757.           paintpict(point(277, 339), "imp_canc.pic", 1, 0)
  758.           quickclick()
  759.           repeat while the mouseDown
  760.           end repeat
  761.           paintpict(point(277, 339), "imp_canc.pic", 0, 0)
  762.           if inside(point(the mouseH, the mouseV), rect(226, 325, 332, 356)) then
  763.             set gAfterSwapScript to EMPTY
  764.             cleardbox()
  765.             set gCDready to 1
  766.             setCDscript()
  767.             go(the frame)
  768.             abort()
  769.             exit
  770.           end if
  771.         end if
  772.       end if
  773.     otherwise:
  774.       if inside(c, rect(266, 324, 372, 356)) then
  775.         paintpict(point(316, 338), "imp_canc.pic", 1, 0)
  776.         quickclick()
  777.         repeat while the mouseDown
  778.         end repeat
  779.         paintpict(point(316, 338), "imp_canc.pic", 0, 0)
  780.         if inside(point(the mouseH, the mouseV), rect(266, 324, 372, 356)) then
  781.           set gAfterSwapScript to EMPTY
  782.           cleardbox()
  783.           set gCDready to 1
  784.           setCDscript()
  785.           go(the frame)
  786.           abort()
  787.           exit
  788.         end if
  789.       end if
  790.   end case
  791. end
  792.  
  793. on cleardbox
  794.   set gStopActions to 0
  795.   set the locV of sprite 41 to 999
  796.   puppetSprite(41, 0)
  797.   updateStage()
  798.   unloaddialog()
  799.   waitSound()
  800.   cursor(-1)
  801. end
  802.  
  803. on scrollcredits
  804.   if gcreditscroll < gscrolllength then
  805.     set gcreditscroll to gcreditscroll + 4
  806.     set the scrollTop of member "credits" to gcreditscroll
  807.     updateStage()
  808.   else
  809.     set endtime to the ticks + 100
  810.     repeat while the ticks < endtime
  811.       flyblimp()
  812.       updateStage()
  813.     end repeat
  814.     navigate(gMainFrame)
  815.     unloadcredits()
  816.   end if
  817. end
  818.  
  819. on gocredits
  820.   set the scrollTop of member "credits" to 0
  821.   set gcreditscroll to 0
  822.   puppetSprite(gBlimpSprite, 0)
  823.   navigate(gCreditsScreen)
  824.   set gscrolllength to the height of member "credits" - 400
  825.   set endtime to the ticks + 100
  826.   repeat while the ticks < endtime
  827.     updateStage()
  828.   end repeat
  829. end
  830.  
  831. on unloadcredits
  832.   repeat with x = 164 to 168
  833.     clearmember(x)
  834.   end repeat
  835. end
  836.  
  837. on getplat
  838.   set plat to the platform
  839.   if item 1 of plat = "macintosh" then
  840.     set gPC to 0
  841.     set f to 1
  842.     set gMovieSuffix to "_mc.mov"
  843.   else
  844.     if item 2 of plat = "32" then
  845.       set gPC to 32
  846.       set f to 3
  847.       set gMovieSuffix to "_pc.mov"
  848.     else
  849.       set gPC to 16
  850.       set f to 2
  851.       set gMovieSuffix to "_pc.mov"
  852.     end if
  853.   end if
  854.   if gVersionType = #full then
  855.     set f to 0
  856.   end if
  857.   set gcafescreen to label("Building4") + f
  858. end
  859.  
  860. on setCDscript
  861.   case gPC of
  862.     16:
  863.       set gCDscript to "go to the frame"
  864.     32:
  865.       set gCDscript to "postEjectScript"
  866.     otherwise:
  867.       set gCDscript to "preEjectScript"
  868.   end case
  869. end
  870.  
  871. on zkey
  872.   if the keyCode = 6 then
  873.     checkversion()
  874.   end if
  875. end
  876.  
  877. on checkpurge
  878.   if the freeBlock > 50000 then
  879.     exit
  880.   end if
  881.   unLoad()
  882. end
  883.